name = 'liuzhengliuzhengliuzhengliuzhengliuzhengliuzhengliuzhengliuzhengliuzheng'
count = 0
# x--临时变量；name---集合
for x in name:
    if x == 'z':
        count += 1
print(count)

# range语法
for x in range(5):
    print(x)
    # [0,1,2,3,4],一个参数表示从零开始的集合长度
for x in range(2,5):
    print(x)
    # [2,3,4]，两个参数从第一个参数到第二个集合参数的集合长度
for x in range(2,10,3):
    print(x)
    # [2,5,8]，第三个参数表示步长，生成等差数列
num = int(input('请输入一个数'))
oushuCount = 0
for x in range(1,num):
    if(x %2 == 0):
        oushuCount +=1
print(f"输入的是{num},其中偶数有{oushuCount}个")

for x in range(1,10):
    for y in range(1, 10):
        if x>=y :
            if(y==x):
               print((f"{x} * {y} = {x * y}\t"))
            else:
                print((f"{x} * {y} = {x * y}\t"),end="")

for x in range(1,10):
    for y in range(1, x+1):
        print((f"{x} * {y} = {x * y}\t"),end="")
    print()
